Optimal. Leaf size=74 \[ \frac {a \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2917, 2691,
3853, 3855, 2687, 30} \begin {gather*} -\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {a \cot (c+d x) \csc (c+d x)}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2687
Rule 2691
Rule 2917
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x)) \, dx &=a \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx+a \int \cot ^2(c+d x) \csc ^3(c+d x) \, dx\\ &=-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{4} a \int \csc ^3(c+d x) \, dx+\frac {a \text {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=-\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{8} a \int \csc (c+d x) \, dx\\ &=\frac {a \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 135, normalized size = 1.82 \begin {gather*} -\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 90, normalized size = 1.22
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )^{3}}}{d}\) | \(90\) |
default | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )^{3}}}{d}\) | \(90\) |
risch | \(-\frac {a \left (3 \,{\mathrm e}^{7 i \left (d x +c \right )}+21 \,{\mathrm e}^{5 i \left (d x +c \right )}-24 i {\mathrm e}^{6 i \left (d x +c \right )}+21 \,{\mathrm e}^{3 i \left (d x +c \right )}+24 i {\mathrm e}^{4 i \left (d x +c \right )}+3 \,{\mathrm e}^{i \left (d x +c \right )}-8 i {\mathrm e}^{2 i \left (d x +c \right )}+8 i\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}\) | \(140\) |
norman | \(\frac {-\frac {a}{64 d}-\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d}-\frac {a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {a \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}\) | \(169\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 80, normalized size = 1.08 \begin {gather*} -\frac {3 \, a {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {16 \, a}{\tan \left (d x + c\right )^{3}}}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 137 vs.
\(2 (66) = 132\).
time = 0.38, size = 137, normalized size = 1.85 \begin {gather*} -\frac {16 \, a \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) + 6 \, a \cos \left (d x + c\right )^{3} + 6 \, a \cos \left (d x + c\right ) - 3 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 3 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 116, normalized size = 1.57 \begin {gather*} \frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 8 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {50 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.59, size = 112, normalized size = 1.51 \begin {gather*} \frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {a}{4}\right )}{16\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________